﻿using System.Collections.Generic;
using System.Linq;

namespace MultiDAQ_Analysis.Calculation.Parameters
{
    public class StandardSourceParameters : MeasurementParameters
    {
        public override string MeasurementType => "StandardSourceEfficiency";

        public double SampleDiskArea { get; set; } = 1400; // mm² (样品盘面积)

        // 标准源比活度 Bq/g（每个通道可能不同）
        public Dictionary<int, double> AlphaSpecificActivity { get; set; } = new Dictionary<int, double>();
        public Dictionary<int, double> BetaSpecificActivity { get; set; } = new Dictionary<int, double>();

        // 标准源质量 mg（每个通道可能不同，PDF中建议 0.1A mg，A为样品盘面积）
        public Dictionary<int, double> SourceMass { get; set; } = new Dictionary<int, double>();

        public override bool Validate()
        {
            return SampleDiskArea > 0 &&
                   AlphaSpecificActivity.Values.All(v => v > 0) &&
                   BetaSpecificActivity.Values.All(v => v > 0) &&
                   SourceMass.Values.All(v => v > 0 && v <= 5000); // PDF中范围1-5000mg
        }

        /// <summary>
        /// 获取推荐的标准源质量（基于样品盘面积）
        /// </summary>
        public double GetRecommendedSourceMass()
        {
            return 0.1 * SampleDiskArea; // PDF建议：0.1A mg，A为样品盘面积
        }
    }
}